#pragma once
#include "HashTable.h"
namespace wnf
{
	template<class K,class Hash = GetKeyForHash<K>>
	class unordered_set
	{
		struct GetSetKey
		{
			const K& operator()(const K& data)
			{
				return data;
			}
		};
	public:

		typedef typename HashTable<K, const K, Hash, GetSetKey>::Iterator iterator;
		typedef typename HashTable<K, const K, Hash, GetSetKey>::ConstIterator const_iterator;

		iterator begin()
		{
			return _ht.begin();
		}
		iterator begin() const
		{
			return _ht.begin();
		}
		iterator end()
		{
			return _ht.end();
		}
		iterator end() const
		{
			return _ht.end();
		}
		pair<iterator,bool> insert(const K& data)
		{
			return _ht.insert(data);
		}

		bool erase(const K& key)
		{
			return _ht.erase(key);
		}

		iterator find(const K& key)
		{
			return _ht.find(key);
		}
	private:
		HashTable<K, const K, Hash, GetSetKey> _ht;
	};
}